package com.huike.controller;

import com.huike.core.controller.BaseController;
import com.huike.dto.ClueDto;
import com.huike.result.MyPageResult;
import com.huike.result.PageResult;
import com.huike.service.CluePoolService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/clues/clue")
@Slf4j
public class CluePoolController extends BaseController {

    @Autowired
    private CluePoolService cluePoolService;

    /**
     * 分页查询线索池
     * @param clueDto
     * @return
     */
    @GetMapping("/pool")
    public MyPageResult getCluePoolListPage(ClueDto clueDto ) {
        log.info("分页查询线索，{}",clueDto);
        PageResult cluePoolListPage = cluePoolService.getClueListPage(clueDto);
        return MyPageResult.ok(cluePoolListPage.getRecords(),cluePoolListPage.getTotal());
    }

}
